package seven.test_7_23;

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Scanner;

public class TestMain1 {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] ave = new int[3 * n];
        for (int i = 0; i < 3 * n; i++) {
            ave[i] = in.nextInt();
        }
        Arrays.sort(ave);
        long sum = 0;
        for (int i = 0; i < n; i++) {
            sum += ave[ave.length - 2 * (i + 1)];
        }
        System.out.println(sum);
    }
}
